package com.nowcoder.community.service;

import com.nowcoder.community.entity.LoginTicket;
import com.nowcoder.community.entity.User;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Map;

@Service
public interface UserService {

    User findUserById(int userId);

    Map<String, Object> register(User user);

    int activate(int userId, String code);

    Map<String, Object> login(String username, String password, long expireSeconds);

    void logOut(String ticket);

    LoginTicket findLoginTicket(String ticket);

    int updateHeader(int userId, String headerURL);

    Map<String, Object> updateUserPassword(User user, String originPassword, String newPassword);

    User findUserByName(String username);

    Collection<? extends GrantedAuthority> getAuthorities(int userId);

}
